Skip to contentSkip to conversation

Change in openvpn[master]: mtu: Trivial -Wconversion fix

Openvpn-devel In review flichtenheld (Code Review) 2 participants 6 messages Oct 6, 2025 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): gerrit.1759763846000.I8919c9efdf85424a124a0d54593cd1dbf3bc2341@...2715...

#1 lore raw

Attention is currently required from: plaisthos.

Hello plaisthos,

I'd like you to do a code review.
Please visit

    http://gerrit.openvpn.net/c/openvpn/+/1250?usp=email

to review the following change.

Change subject: mtu: Trivial -Wconversion fix
......................................................................

mtu: Trivial -Wconversion fix

Just use the correct type.

Change-Id I8919c9efdf85424a124a0d54593cd1dbf3bc2341

---
M src/openvpn/mtu.c

1 file changed, 1 insertion(+), 11 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/50/1250/1

src/openvpn/mtu.c +1 -11
index 66f81a6..9e152df 100644
@@ -280,15 +280,9 @@
     struct timeval tv;
 };
 
-#if defined(__GNUC__) || defined(__clang__)
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wconversion"
-#endif
-
 const char *
 format_extended_socket_error(int fd, int *mtu, struct gc_arena *gc)
 {
-    int res;
     struct probehdr rcvbuf;
     struct iovec iov;
     struct msghdr msg;
@@ -313,7 +307,7 @@
         msg.msg_control = cbuf;
         msg.msg_controllen = 256; /* size of cbuf */
 
-        res = recvmsg(fd, &msg, MSG_ERRQUEUE);
+        ssize_t res = recvmsg(fd, &msg, MSG_ERRQUEUE);
         if (res < 0)
         {
             goto exit;
@@ -394,10 +388,6 @@
     return BSTR(&out);
 }
 
-#if defined(__GNUC__) || defined(__clang__)
-#pragma GCC diagnostic pop
-#endif
-
 void
 set_sock_extended_error_passing(int sd, sa_family_t proto_af)
 {

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1250?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I8919c9efdf85424a124a0d54593cd1dbf3bc2341
Gerrit-Change-Number: 1250
Gerrit-PatchSet: 1
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>

#2 lore raw
In reply to a message not in the archive

Attention is currently required from: flichtenheld, plaisthos.

cron2 has posted comments on this change by flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/1250?usp=email )

Change subject: mtu: Trivial -Wconversion fix
......................................................................

Patch Set 2: Code-Review+2

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1250?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I8919c9efdf85424a124a0d54593cd1dbf3bc2341
Gerrit-Change-Number: 1250
Gerrit-PatchSet: 2
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Comment-Date: Mon, 06 Oct 2025 17:04:51 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes

#3 lore raw

PATCH v2 1/1 mtu: Trivial -Wconversion fix

In reply to a message not in the archive

From: Frank Lichtenheld <[email protected]...>

Just use the correct type.

Change-Id I8919c9efdf85424a124a0d54593cd1dbf3bc2341

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1250
---

This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master.

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1250
This mail reflects revision 2 of this Change.

Acked-by according to Gerrit (reflected above):
Gert Doering <[email protected]...>

src/openvpn/mtu.c +1 -11
index 66f81a6..9e152df 100644
@@ -280,15 +280,9 @@
     struct timeval tv;
 };
 
-#if defined(__GNUC__) || defined(__clang__)
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wconversion"
-#endif
-
 const char *
 format_extended_socket_error(int fd, int *mtu, struct gc_arena *gc)
 {
-    int res;
     struct probehdr rcvbuf;
     struct iovec iov;
     struct msghdr msg;
@@ -313,7 +307,7 @@
         msg.msg_control = cbuf;
         msg.msg_controllen = 256; /* size of cbuf */
 
-        res = recvmsg(fd, &msg, MSG_ERRQUEUE);
+        ssize_t res = recvmsg(fd, &msg, MSG_ERRQUEUE);
         if (res < 0)
         {
             goto exit;
@@ -394,10 +388,6 @@
     return BSTR(&out);
 }
 
-#if defined(__GNUC__) || defined(__clang__)
-#pragma GCC diagnostic pop
-#endif
-
 void
 set_sock_extended_error_passing(int sd, sa_family_t proto_af)
 {
#4 lore raw

[Openvpn-devel] [PATCH applied] Re: mtu: Trivial -Wconversion fix

"just write nice code" ;-) - but indeed, this one is easy.

Your patch has been applied to the master branch.

commit 4fa3897915745375c6b832796baf3d7a6a686d43

Author: Frank Lichtenheld
Date:   Mon Oct 6 19:04:58 2025 +0200
     mtu: Trivial -Wconversion fix

     Signed-off-by: Frank Lichtenheld <[email protected]...>
     Acked-by: Gert Doering <[email protected]...>
     Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1250
     Message-Id: <[email protected]...>
     URL: https://sourceforge.net/p/openvpn/mailman/message/59242982/
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering

#5 lore raw
In reply to a message not in the archive

cron2 has uploaded a new patch set (#3) to the change originally created by flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/1250?usp=email )

The following approvals got outdated and were removed:
Code-Review+2 by cron2

Change subject: mtu: Trivial -Wconversion fix
......................................................................

mtu: Trivial -Wconversion fix

Just use the correct type.

Change-Id I8919c9efdf85424a124a0d54593cd1dbf3bc2341

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1250
Message-Id: <[email protected]...>
URL: https://sourceforge.net/p/openvpn/mailman/message/59242982/

---
M src/openvpn/mtu.c

1 file changed, 1 insertion(+), 11 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/50/1250/3

src/openvpn/mtu.c +1 -11
index 66f81a6..9e152df 100644
@@ -280,15 +280,9 @@
     struct timeval tv;
 };
 
-#if defined(__GNUC__) || defined(__clang__)
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wconversion"
-#endif
-
 const char *
 format_extended_socket_error(int fd, int *mtu, struct gc_arena *gc)
 {
-    int res;
     struct probehdr rcvbuf;
     struct iovec iov;
     struct msghdr msg;
@@ -313,7 +307,7 @@
         msg.msg_control = cbuf;
         msg.msg_controllen = 256; /* size of cbuf */
 
-        res = recvmsg(fd, &msg, MSG_ERRQUEUE);
+        ssize_t res = recvmsg(fd, &msg, MSG_ERRQUEUE);
         if (res < 0)
         {
             goto exit;
@@ -394,10 +388,6 @@
     return BSTR(&out);
 }
 
-#if defined(__GNUC__) || defined(__clang__)
-#pragma GCC diagnostic pop
-#endif
-
 void
 set_sock_extended_error_passing(int sd, sa_family_t proto_af)
 {

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1250?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I8919c9efdf85424a124a0d54593cd1dbf3bc2341
Gerrit-Change-Number: 1250
Gerrit-PatchSet: 3
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>

#6 lore raw
In reply to a message not in the archive

cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/1250?usp=email )

Change subject: mtu: Trivial -Wconversion fix
......................................................................

mtu: Trivial -Wconversion fix

Just use the correct type.

Change-Id I8919c9efdf85424a124a0d54593cd1dbf3bc2341

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1250
Message-Id: <[email protected]...>
URL: https://sourceforge.net/p/openvpn/mailman/message/59242982/

---
M src/openvpn/mtu.c

1 file changed, 1 insertion(+), 11 deletions(-)
src/openvpn/mtu.c +1 -11
index 66f81a6..9e152df 100644
@@ -280,15 +280,9 @@
     struct timeval tv;
 };
 
-#if defined(__GNUC__) || defined(__clang__)
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wconversion"
-#endif
-
 const char *
 format_extended_socket_error(int fd, int *mtu, struct gc_arena *gc)
 {
-    int res;
     struct probehdr rcvbuf;
     struct iovec iov;
     struct msghdr msg;
@@ -313,7 +307,7 @@
         msg.msg_control = cbuf;
         msg.msg_controllen = 256; /* size of cbuf */
 
-        res = recvmsg(fd, &msg, MSG_ERRQUEUE);
+        ssize_t res = recvmsg(fd, &msg, MSG_ERRQUEUE);
         if (res < 0)
         {
             goto exit;
@@ -394,10 +388,6 @@
     return BSTR(&out);
 }
 
-#if defined(__GNUC__) || defined(__clang__)
-#pragma GCC diagnostic pop
-#endif
-
 void
 set_sock_extended_error_passing(int sd, sa_family_t proto_af)
 {

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1250?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: merged
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I8919c9efdf85424a124a0d54593cd1dbf3bc2341
Gerrit-Change-Number: 1250
Gerrit-PatchSet: 3
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>